package com.xiaomi.service.impl;

import com.xiaomi.entity.Manager;
import com.xiaomi.mapper.ManagerMapper;
import com.xiaomi.service.ManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName ManagerServiceImpl
 * @Description TODO
 * @Author zcy
 * @Date 2021/11/29 11:15
 * @Version 1.0
 **/
@Service
public class ManagerServiceImpl implements ManagerService {
    @Autowired
    private ManagerMapper managerMapper;
    @Override
    public List<Manager> pageSearch(Integer startRow, Integer limit, Integer managerId, String managerName) {
        return managerMapper.pageSearch(startRow, limit, managerId, managerName);
    }

    @Override
    public Integer getCount(Integer managerId, String managerName) {
        return managerMapper.getCount(managerId, managerName);
    }

    @Override
    @Transactional
    public void insert(Manager manager) {
managerMapper.insert(manager);
    }

    @Override
    @Transactional
    public void update(Manager manager) {
managerMapper.update(manager);
    }

    @Override
    public void delete(Integer managerId) {
        managerMapper.delete(managerId);

    }
}
